package com.zhihuishu.micro.course.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Table(name = "USER_VIEW_LOG")
public class UserViewLog {
    @Id
    @Column(name = "USER_ID")
    private long userId;// 观看用户id

    @Id
    @Column(name = "COURSE_ID")
    private long courseId;// 观看的课程id

    @Id
    @Column(name = "MODULE")
    private int module;// 用户观看的步骤(1--6)

    @Id
    @Column(name = "VIEW_POINT")
    private int viewPoint;// 用户观看的点,只有第三步有用(1表示节,2表示小节)其余默认为0

    @Id
    @Column(name = "VIEW_POINT_ID")
    private int viewPointId;// 用户观看点的id,只有第三步有用(表示的是节id或者小节id)其余默认为0

    @Transient
    private String field;// 采用module-point-pointId 用于Hash的Field

    @Column(name = "LAST_VIEW_TIME")
    private long lastViewTime;// 最后查看时间(为了方便redis存储以及比较 采用时间戳的形式来存储)
    @Column(name="LAST_VIEW_DATE")
    private Date lastViewDate;//最后查看时间

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getCourseId() {
        return courseId;
    }

    public void setCourseId(long courseId) {
        this.courseId = courseId;
    }

    public int getModule() {
        return module;
    }

    public void setModule(int module) {
        this.module = module;
    }

    public int getViewPoint() {
        return viewPoint;
    }

    public void setViewPoint(int viewPoint) {
        this.viewPoint = viewPoint;
    }

    public int getViewPointId() {
        return viewPointId;
    }

    public void setViewPointId(int viewPointId) {
        this.viewPointId = viewPointId;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public long getLastViewTime() {
        return lastViewTime;
    }

    public void setLastViewTime(long lastViewTime) {
        this.lastViewTime = lastViewTime;
    }

    public Date getLastViewDate() {
        return lastViewDate;
    }

    public void setLastViewDate(Date lastViewDate) {
        this.lastViewDate = lastViewDate;
    }

    @Override
    public String toString() {
        return "UserViewLog [userId=" + userId + ", courseId=" + courseId + ", module=" + module
                + ", viewPoint=" + viewPoint + ", viewPointId=" + viewPointId + ", field=" + field
                + ", lastViewTime=" + lastViewTime + ", lastViewDate=" + lastViewDate + "]";
    }

    

}
